<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="format-detection" content="telephone=no">
    #parse("/h5/common/webWords.html")
<link rel="stylesheet" type="text/css" href="http://116.255.210.85:9911/css/medioadaption.css">
<link rel="stylesheet" type="text/css" href="http://116.255.210.85:9911/css/stcss.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="http://${staticHost}/js/jquery.md5.js"></script>

<script type="text/javascript">

	$(document).ready(function(){
		//登录cookie
		var phoneNumber = '${phoneNumber}';
		var password = '${password}';
		$("#phoneNumber").val(phoneNumber);
		$("#password").val(password);
        // if(phoneNumber != '' && password != ''){
        //     // login(phoneNumber, password, 0);
        //     $("#phoneNumber").val(phoneNumber);
        //     $("#password").val(password);
        // }
		
		$("#login").click(function(){
			var checkParam = true;
			$("#login").attr("checkStatus", "1");
			var phoneNumber = $("#phoneNumber").val();
			var password = $("#password").val();
			var remFlag = 0;

			if(phoneNumber == ''){
				$("#phoneNumberDiv").text("请输入您的手机号");
				checkParam = false;
			}
			if(password == ''){
				checkParam = false;
				$("#passwordDiv").text("请输入您的密码");
			}
			if(checkParam){
				//记住密码
				var isChecked = $("#keepPassword").is(":checked");
				if(isChecked){
					var conFlag = confirm("记录密码功能不宜在公共场所(如网吧等)使用,以防密码泄露.您确定要使用此功能吗?");
					if(conFlag){ //确认标志
						remFlag = 1;
			        }

				}
			}
            login(phoneNumber, $.md5(password), remFlag);
		});

		function login(phoneNumber, password, remFlag){
			var toUrl = $("#toUrl").val();
            $.ajax({
                type:'post',
                url:'${requestHost}/edu/public/login',
                contentType:'application/x-www-form-urlencoded; charset=utf-8',
                data:{
                    phoneNumber:phoneNumber,
                    password:password,
                    remFlag:remFlag,
                    studentType:6,
                    toUrl:toUrl
                },
                success: function (result) {
                    if(result.status == '00000000'){
                        var toUrl = result.result.toUrl;
                        if("" != toUrl && toUrl != undefined){
                        	window.location.href=toUrl;
                        }
                    }else{
                        $("#passwordDiv").text(result.message);
                    }
                }
            });
        }
		
		$("#phoneNumber").blur(function(){
			var phoneNumber = $("#phoneNumber").val();
			if(phoneNumber != ''){
				$("#phoneNumberDiv").text("");
			}
		});
		
		$("#password").blur(function(){
			var password = $("#password").val();
			if(password != ''){
				$("#passwordDiv").text("");
			}
		});

		$("#phoneNumber").on('input', function () {
            $("#password").val("");
        });
		
	});

</script>
</head>


<body style="background-color:#f8f8f8;">
<div class="md_head">
   <div class="md_logo"><img src="http://116.255.210.85:9911/images/logo2.png"></div>
   <div class="md_bt">梦想在线业务员服务系统</div>
   <input type="hidden" remFlag="0" id="remFlag"/>
   <input type="hidden" value="$!{toUrl}" id="toUrl">
   <div class="login-box">
       <div class="login-box-width">
           <ul>
               <li>
                   <div class="form-box clearfix">
                       <i></i>
                       <input type="text" id="phoneNumber" style="width: 60%;padding: 0 2%;" placeholder="请输入您的手机号">
                   </div>
                   <div id="phoneNumberDiv" style="color:red;"></div>

               </li>
               <li class="password-input">
                   <div class="form-box clearfix">
                       <i></i>
                       <input type="password" id="password" style="width: 60%;padding: 0 2%;" placeholder="请输入您的密码">
                   </div>
                   <div id="passwordDiv" style="color:red;"></div>
               </li>
           </ul>
           <div class="am-checkbox" style="height: 2px;">

            </div>
           <div class="md_dl"><input checkStatus="" name="login" id="login" type="image" src="http://116.255.210.85:9911/images/01.jpg" style="width:290px; height:42px; border:none;" /></div>
       </div>
   </div>
</div>
</body>
</html>
